package cn.hznc.controller.service.production.logic;

import cn.hznc.domain.entity.ProcessBomEntity;
import cn.hznc.domain.entity.ProductionBomEntity;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
public class ProductionBomDo{

    private List<ProductionBomEntity> createElement= new ArrayList<>();
    private List<ProductionBomEntity> deleteElement= new ArrayList<>();
    private List<ProductionBomEntity> updateElement= new ArrayList<>();


    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addCreateElement(ProductionBomEntity element){
        return createElement.add(element);
    }

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addCreateElement(List<ProductionBomEntity> element){
        return createElement.addAll(element);
    }

    /**
     * 添加删除的元素
     *
     * @param element element
     * @return boolean
     */
    public boolean addDeleteElement(ProductionBomEntity element){
        return deleteElement.add(element);
    }

    /**
     * 添加删除的元素
     *
     * @param element element
     * @return boolean
     */
    public boolean addDeleteElement(List<ProductionBomEntity> element){
        return deleteElement.addAll(element);
    }

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addUpdateElement(ProductionBomEntity element){
        return updateElement.add(element);
    }
}
